import React from "react";

export default function Usestate() {
  let [gotoclass, setgotoclass] = React.useState(true);

  let changeclass = () => {
    setgotoclass(!gotoclass);
  };
  return (
    <>
      <h1> 学习 Usestate</h1>
      <h2>今天来上课吗？{gotoclass ? "上课啊" : "上个毛回去打游戏"}</h2>
      <button onClick={changeclass}>上？不上？</button>
    </>
  );
}
